package c.h.a.x;

import android.graphics.drawable.Drawable;
import c.h.a.m0.n;

/* compiled from: lambda */
public final /* synthetic */ class p implements Runnable {
    public final /* synthetic */ Drawable a;
    public final /* synthetic */ n b;
    public final /* synthetic */ String c;

    public /* synthetic */ p(Drawable drawable, n nVar, String str) {
        this.a = drawable;
        this.b = nVar;
        this.c = str;
    }

    /* JADX WARNING: Missing exception handler attribute for start block: B:28:0x0095 */
    /* JADX WARNING: Removed duplicated region for block: B:45:? A:{SYNTHETIC, RETURN} */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x00a2 A:{SYNTHETIC, Splitter:B:31:0x00a2} */
    /* JADX WARNING: Removed duplicated region for block: B:36:0x00a9 A:{SYNTHETIC, Splitter:B:36:0x00a9} */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Can't wrap try/catch for region: R(5:26|25|28|29|(0)(0)) */
    /* JADX WARNING: Missing block: B:27:0x0093, code skipped:
            r0 = th;
     */
    /* JADX WARNING: Missing block: B:32:?, code skipped:
            r2.close();
     */
    /* JADX WARNING: Missing block: B:34:0x00a6, code skipped:
            r3 = r2;
     */
    /* JADX WARNING: Missing block: B:37:?, code skipped:
            r3.close();
     */
    /* JADX WARNING: Missing block: B:40:?, code skipped:
            return;
     */
    /* JADX WARNING: Missing block: B:45:?, code skipped:
            return;
     */
    public final void run() {
        /*
        r8 = this;
        r0 = r8.a;
        r1 = r8.b;
        r2 = r8.c;
        r3 = r0 instanceof android.graphics.drawable.BitmapDrawable;
        if (r3 == 0) goto L_0x001f;
    L_0x000a:
        r0 = (android.graphics.drawable.BitmapDrawable) r0;
        r0 = r0.getBitmap();
        if (r0 != 0) goto L_0x0045;
    L_0x0012:
        r1.getClass();
        r0 = new c.h.a.x.a;
        r0.m2151init(r1);
        c.h.a.m0.p.a.b(r0);
        goto L_0x00a5;
    L_0x001f:
        r3 = r0.getIntrinsicWidth();
        r4 = r0.getIntrinsicHeight();
        r5 = 1;
        if (r3 > 0) goto L_0x002b;
    L_0x002a:
        r3 = 1;
    L_0x002b:
        if (r4 > 0) goto L_0x002e;
    L_0x002d:
        r4 = 1;
    L_0x002e:
        r5 = android.graphics.Bitmap.Config.ARGB_8888;
        r5 = android.graphics.Bitmap.createBitmap(r3, r4, r5);
        r6 = new android.graphics.Canvas;
        r6.<init>(r5);
        r0 = r0.mutate();
        r7 = 0;
        r0.setBounds(r7, r7, r3, r4);
        r0.draw(r6);
        r0 = r5;
    L_0x0045:
        r3 = c.h.a.x.r.c;
        r4 = c.h.a.m0.j.e(r3);
        if (r4 != 0) goto L_0x0059;
    L_0x004d:
        r1.getClass();
        r0 = new c.h.a.m0.a;
        r0.m2067init(r1);
        c.h.a.m0.p.a.b(r0);
        goto L_0x00a5;
    L_0x0059:
        r4 = new java.io.File;
        r4.<init>(r3, r2);
        r2 = c.h.a.m0.j.b(r4);
        if (r2 != 0) goto L_0x0070;
    L_0x0064:
        r1.getClass();
        r0 = new c.h.a.m0.a;
        r0.m2067init(r1);
        c.h.a.m0.p.a.b(r0);
        goto L_0x00a5;
    L_0x0070:
        r2 = 0;
        r3 = new java.io.FileOutputStream;	 Catch:{ IOException -> 0x0095 }
        r3.<init>(r4);	 Catch:{ IOException -> 0x0095 }
        r2 = android.graphics.Bitmap.CompressFormat.PNG;	 Catch:{ IOException -> 0x0091, all -> 0x008f }
        r4 = 100;
        r0.compress(r2, r4, r3);	 Catch:{ IOException -> 0x0091, all -> 0x008f }
        r3.flush();	 Catch:{ IOException -> 0x0091, all -> 0x008f }
        r1.getClass();	 Catch:{ IOException -> 0x0091, all -> 0x008f }
        r0 = new c.h.a.m0.b;	 Catch:{ IOException -> 0x0091, all -> 0x008f }
        r0.m2068init(r1);	 Catch:{ IOException -> 0x0091, all -> 0x008f }
        c.h.a.m0.p.a.b(r0);	 Catch:{ IOException -> 0x0091, all -> 0x008f }
        r3.close();	 Catch:{ IOException -> 0x00a5 }
        goto L_0x00a5;
    L_0x008f:
        r0 = move-exception;
        goto L_0x00a7;
    L_0x0091:
        r2 = r3;
        goto L_0x0095;
    L_0x0093:
        r0 = move-exception;
        goto L_0x00a6;
    L_0x0095:
        r1.getClass();	 Catch:{ all -> 0x0093 }
        r0 = new c.h.a.m0.a;	 Catch:{ all -> 0x0093 }
        r0.m2067init(r1);	 Catch:{ all -> 0x0093 }
        c.h.a.m0.p.a.b(r0);	 Catch:{ all -> 0x0093 }
        if (r2 == 0) goto L_0x00a5;
    L_0x00a2:
        r2.close();	 Catch:{ IOException -> 0x00a5 }
    L_0x00a5:
        return;
    L_0x00a6:
        r3 = r2;
    L_0x00a7:
        if (r3 == 0) goto L_0x00ac;
    L_0x00a9:
        r3.close();	 Catch:{ IOException -> 0x00ac }
    L_0x00ac:
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.h.a.x.p.run():void");
    }
}
